import React from 'react';

import BaseModelNew from './BaseModelNew';
import Config from '../config';

export default class JanyiModel extends BaseModelNew {
	constructor() {
		super();
		this.sendRequestSubmit = this.sendRequestSubmit.bind(this);
		this.sendRequestSuggestOwned = this.sendRequestSuggestOwned.bind(this);
	}

	// 提交建议
	sendRequestSubmit(data, callback) {
		var url = Config.serverNoHostUrl + '/suggest/submit';
		this.sendPost(url, JSON.stringify(data), callback);
	}

	// 获取自己的建议列表
	sendRequestSuggestOwned(data, callback) {
		var url = Config.serverNoHostUrl + '/suggest/owned?page='+data.page+'&page_size=10&sort_id='+data.sort_id;
		this.sendGet(url, callback);
	}
}
